package com.ptl.bp.config;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;


@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public class BizException extends RuntimeException {

    private ApiResult.ResStatusEnum code = ApiResult.ResStatusEnum.BAD_REQUEST;
    private String message;

    public BizException(ApiResult.ResStatusEnum code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }

    public BizException(ApiResult.ResStatusEnum code, String message) {
        this(code, message, null);
    }

    public BizException(String message) {
        this(null, message, null);
    }
}